1. Field of the Invention
The present invention relates to a method for prefiltering image data to so that data compression can be preformed while better preserving important information.
2. Description of the Related Art
I. Acquiring Image by Scanning
Digital document systems typically capture an image by sampling it at regularly spaced points on a two-dimensional grid. Each sample point is represented by the value of the intensity at that point for black-and-white scanners, and as three values for the intensities of red, blue, and green for color scanners. Depending on the quality desired, the number of bits per value varies from 4 to 12 and the number of samples per inch varies anywhere from 100 per inch for low quality scanners to over 2000 per inch for very high quality scanners. Typical commercial scanners for businesses documents operate at 8 bits per pixel and 300-600 samples per inch (spi) For a 300 spi scanner, a single 8.5xc3x9711 inch page represents approximately 8.5 million bytes of data for a raw scanned image. For a 600 spi scanner, this increases to 33.7 million bytes. Given this large data size, a key problem for document systems is to find compact ways of encoding the data for storage and transmission while still being able to reproduce the image from the encoded form at a quality commensurate with that of the scanned image.
II. Compression Techniques
To reduce the amount of memory space required to store a scanned image, compression techniques can be applied to the scanned image before the image data is stored. Some techniques for compressing images use a single algorithm over the whole image. Examples of such algorithms are the CCITT G3 and G4 bitmap compression algorithms, JBIG and JPEG. These algorithms have been designed to work well on particular classes of images, but will not work well across all classes. For example, CCITT G3 and G4 work well with bitmaps representing text or line-art, while JPEG is designed for encoding photographs which typically contain smooth changes from one pixel to the next. Typical documents, however, contain a mixture of textual and pictorial material on the same page. As a result using a single compression algorithm on the whole page represents a poor compromise between the size of the compressed image and the quality of the image that can be reproduced from it.
A different approach for compressing image data containing more than one class of images is to use segmentation to divide the image into disjoint regions and compress each region using an algorithm suited to that region. Such a compression technique is disclosed in U.S. patent application Ser. No. 09/013,480 entitled xe2x80x9cAdaptive Quantization Compatible With The JPEG Baseline Sequential Modexe2x80x9d, to Sindhu.
III. Image Types
In the images typically encountered by digital document processing systems, there are at least four types of regions including: Flat, LineArt, Halftone and Contone.
Flat regions correspond to image background, have no visible detail, and are typically either white or some other lighter color. Flat regions are interesting because they can be encoded very efficiently, and overall image quality can be improved significantly by eliminating the xe2x80x9csalt and pepperxe2x80x9d noise that is sometimes present in such regions.
Lineart regions correspond to text and other sharp edge features such as line drawings or filled shapes. Lineart is interesting to separate out because it can be compressed efficiently using lossless binary algorithms, and its quality can be improved by enhancing edges and enforcing the use of two colors (typically black and white) during rendering.
Finally, Halftone and Contone regions correspond to the pictorial parts of an image which are best compressed with algorithms such as JPEG. Halftone regions are those where the pictorial was produced using a printing process that has a small number of distinct color separations available (typically 5 or less) and so the impression of smooth changes in intensity and color was created by using half-tone dots or error diffusion. Contone regions, on the other hand, are those that were printed using a process such as photography that can produce continuous changes in color and intensity. Although JPEG can be used to compress both Halftone and Contone regions, substantial gains can be made in compression ratio by tuning the algorithm""s parameters to the type or region. Furthermore, the rendering algorithms that can render Halftone regions well are different from those that can render Contone regions well, so it is interesting to distinguish between them from a rendering standpoint as well.
IV. Texture
A fundamental property of images that is important in helping to discriminate between the four basic regions is texture. Intuitively, texture is simply the small-scale patterning that gives an image its feel of being more or less xe2x80x9cbusyxe2x80x9d. Flat regions, which are essentially featureless have the smallest texture. Contone regions where there are smooth variations from one pixel to the next have higher texture. Lineart regions with frequent sharp changes come next. Finally Halftone regions have the highest texture because of the presence of halftone or error diffusion dots.
A function to identify the texture of components of a scanned image can be used to discriminate between the four basic categories of regions. Tags can be linked to the image regions to identify the category which the image data falls into. Different compression techniques can then be used which are best suited to each category of image depending on the tag applied to the region as described in U.S. patent application Ser. No. 09/013,480.
Before an image is compressed, the image is segmented and tagged as belonging in a first region, such as a Lineart region, in which edges are the most important information, or a second region, such as a Contone or Halftone Region, in which pixel level is the most important information.
In accordance with the present invention, prior to compression dynamic filters condition the image data passing into the two compressors. Each filter attempts to suppress noise associated with its particular channel by applying a smoothing filter, no filter or a sharpening filter based on segmentation tags and other characteristics of the data. The net effect is improved compression with good image quality.